ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods






FUNCTION:  WeekdayName( )

WeekDay(WeekDay, Abbreviate, FirstDayofWeek)

The WeekdayName function returns the full spelling of the name of the day of the week.


There is one mandatory argument.

WeekDay

The WeekDay argument is the number representing the day of the week as defined below by the value in the Date And Time Constants.

CONSTANTVALUEDESCRIPTION
VBSunday1Sunday
VBMonday2Monday
VBTuesday3Tuesday
VBWednesday4Wednesday
VBThursday5Thursday
VBFriday6Friday
VBSaturday7Saturday
VBFirstJan11Week of January 1
VBFirstFourDays2First week of the year that has at least four days
VBFirstFullWeek3First full week of the year
VBUseSystemD>0Use the date format of the computer's regionsl settings
VBUseSystemDayOfWeek0Use the first full day of the week as defined by the system settings


Code:
<% =WeekdayName(7) %>

Output:
Saturday

There are two optional arguments.

Abbreviate

The optional Abbreviate argument is a Boolean value which gives the option of having the returned day name being abbreviated to the first three characters.

If set to True, the name will be abbreviated. If set to False the name will not be abbreviated.

Code:
<% =WeekdayName(7, True) %>

Output:
Sat

FirstDayofWeek

The optional FirstDayofWeek argument must only use the constants or values defined above in the Date And Time Constants.

In this example, Monday is defined to be the first day of the week. Therefore, Saturday becomes 6.

Code:
<% =WeekdayName(6, False, 2) %>

Output:
Saturday

Code:
<% =WeekdayName(6, False, VBMonday) %>

Output:
Saturday